package cn.lytcom.architecture.manager;

import android.content.Context;

import cn.lytcom.architecture.persistence.SharedPrefs;

/**
 * Created by lytcom on 2017/4/23.
 */

public class SpManager {

    private Context context;

    private class Name {
        static final String USER_NAME = "user_name";
        static final String EMAIL_URL = "email_url";
    }

    public SpManager(Context context) {
        this.context = context.getApplicationContext();
    }

    public String getUserName() {
        return SharedPrefs.getString(context, Name.USER_NAME, "");
    }

    public boolean setUserName(String userName) {
        return SharedPrefs.putString(context, Name.USER_NAME, userName);
    }

    public String getEmailUrl() {
        return SharedPrefs.getString(context, Name.EMAIL_URL, "");
    }

    public boolean setEmailUrl(String emailUrl) {
        return SharedPrefs.putString(context, Name.EMAIL_URL, emailUrl);
    }
}
